package com.test.test.utils.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 参数匹配 2种方法  args execution
 * @author runkeen3
 *
 */
/*@Aspect
@Component*/
public class ParamAspect {
	
	// 参数类型精确匹配
	@Pointcut("args(Integer) && within(com.test.test.service.impl.*)")
	public void argsDemo(){
		
	}
	// 参数类型模糊匹配 within 指定包
	@Pointcut("args(Integer,..) && within(com.test.test.service.impl.*)")
	public void argsLikeDemo(){
		
	}
	
	// 参数类型精确匹配
	@Pointcut("execution(* com.test.test.service.impl..find*(Integer))")
	public void executionDemo(){
		
	}
	// 参数类型模糊匹配 within 指定包
	@Pointcut("execution(* *..find*(Integer,..))")
	public void executionLikeDemo(){
		
    }
	@Before("executionDemo()")
	public void before(){
		System.out.println("参数匹配 ");
	}
	
}
